package com.example.springlogdemo.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LoggerController {
//    private Logger logger = LoggerFactory.getLogger(LoggerController.class);

//    @RequestMapping("/log")
//    public String logger(){
//        logger.info("---------------日志~---------------");
//        logger.debug("debug日志");
//        logger.error("error日志");
//        logger.info("info日志");
//        logger.warn("warn日志");
//        return "ok";
//    }

    @RequestMapping("/log")
    public String logger2(){
        log.info("Hello,world~");
        log.warn("你好,世界~");
        log.error("你好,世界~~~~");
        return "OKOK";
    }

}
